package cn.com.surker.sale.dao;

import cn.com.surker.sale.entity.SaleContractStrengthPrice;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 销售强度价格表 Mapper 接口
 * </p>
 *
 * @author admin
 * @since 2024-06-17
 */
public interface SaleContractStrengthPriceDao extends BaseMapper<SaleContractStrengthPrice> {

    /**
     * 验证合同下的标号信息是否存在
     * @param orgId
     * @param contractId
     * @param strengthId
     * @param takeTime
     * @return
     */
    SaleContractStrengthPrice findTakeTime(Long orgId, Long contractId, Long strengthId, Date takeTime);

    /**
     * 批量新增
     * @param list
     * @return
     */
    Integer saveBatch(List<SaleContractStrengthPrice> list);

    /**
     * 查询合同最后及最新价格
     * @param orgId
     * @param contractId
     * @param sort
     * @return
     */
    List<Map<String, Object>> findContractStrength(Long orgId, Long contractId, String takeTime, String sort);

	/**
	 * 查询合同最后及最新价格
	 * @param orgId
	 * @param contractId
	 * @param sort
	 * @return
	 */
	List<Map<String, Object>> findContractStrengthV1(Long orgId, Long contractId, String takeTime, String sort);

	/**
	 * 查询最大的价格标号
	 *
	 * @param conId
	 * @return
	 */
	SaleContractStrengthPrice findMaxPrice(Long conId, Date nowDate);

	/**
	 * 查询合同标号的生产价格
	 *
	 * @param conId      合同id
	 * @param strengthId 强度等级id
	 * @param taskTime   生效时间
	 * @return
	 */
	SaleContractStrengthPrice findProPrice(Long conId, Long strengthId, Date taskTime);
}
